<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>用new构造函数</title>
</head>
<body>
    <script>
        function Gu(name,age,sex,appearance){
            this .name=name;
            this.age=age;
            this.sex=sex;
            this.appearance=appearance;
            this.fun=function () {
                console.log('大家好我是'+name+sex+'今年'+age+'岁了是个'+appearance+'boy')
            }
        }
        var pan=new Gu('潘国威','20','男','handsome');
        console.log(pan)
        pan.fun();
    </script>
</body>
</html>